<?php


require_once '../ConnectFour.php';
require_once '../FourInALinePlayer.php';
require_once '../Player.php';

class StateMachineTest extends PHPUnit_Framework_TestCase {

    public function testAddMoveChecker() {
        $grid = array(
            array(1, 1, 1, null, null),
            array(null, null, null, null, null),
            array(null, null, null, null, null),
            array(null, null, null, null, null),
            array(null, null, null, null, null));

        $moveChecker = new \DankerBot\MoveChecker();
        $player = new \DankerBotPlayer(FourInALinePlayer::PLAYER_ONE, 5, 5);
        $board = new \DankerBot\Board($grid, $player, $moveChecker);

        $machine = new \DankerBot\StateMachine($player, $board, $moveChecker);
        $machine->addMove($grid, 0);

        $new = array(
            array(1, 1, 1, 1, null),
            array(null, null, null, null, null),
            array(null, null, null, null, null),
            array(null, null, null, null, null),
            array(null, null, null, null, null));

        //$this->assertNotEquals($grid, $new);
        $this->assertEquals($grid, $new);


        $grid = array(
            array(1, 1, 1, null, null),
            array(null, null, null, null, null),
            array(1, 1, null, null, null),
            array(null, null, null, null, null),
            array(null, null, null, null, null));
        
        $machine->addMove($grid, 2);

        $new = array(
            array(1, 1, 1, null, null),
            array(null, null, null, null, null),
            array(1, 1, 1, null, null),
            array(null, null, null, null, null),
            array(null, null, null, null, null));

        //$this->assertNotEquals($grid, $new);
        $this->assertEquals($grid, $new);

    }

    public function testGetStateMove(){
        
    }

}